package com.hooya.fa.eu.biz.controller;

import com.hooya.fa.eu.biz.service.InvoiceService;
import com.hooya.integrated.common.core.util.R;
import com.hooya.integrated.common.security.annotation.Inner;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description 1
 * @Author : Zongz
 * @Copyright Copyright (c) 豪雅集团
 * @Create 2023/12/21
 * @Version 1.0.0
 */
@RestController
@RequiredArgsConstructor
@Tag(name = "发票")
@RequestMapping("/invoice")
public class InvoiceController {

    private final InvoiceService invoiceService;

    @PostMapping("/b2b/add")
    @Inner(value = false)
    @Operation(summary = "新增b2b发票及详情【√】", description = "新增b2b发票及详情")
    public R<Void> addB2BInvoice(@RequestParam("startDate") String startDate,
                                 @RequestParam("endDate") String endDate) {
        invoiceService.addB2BInvoice(startDate, endDate);
        return R.ok();
    }

    @PostMapping("/zy/add")
    @Inner(value = false)
    @Operation(summary = "新增转运发票及详情【√】", description = "新增转运发票及详情")
    public R<Void> addZyInvoice(@RequestParam("startDate") String startDate,
                                @RequestParam("endDate") String endDate) {
        invoiceService.addZyInvoice(startDate, endDate);
        return R.ok();
    }

}
